<template>
  <el-breadcrumb class="hd-breadcrumb" separator-class="el-icon-arrow-right">
    <transition-group name="breadcrumb">
      <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.name"
       :to="{ name: item.name ,query: item.name === 'iframes' ? {auth: $store.state['common/common'].indexRouter} : {}}">
        <span
          v-if="index==levelList.length-1"
          class="no-redirect"
        >{{ item.title }}</span>
        <!-- @click.prevent="handleLink(item)" -->
        <a v-else>{{ item.title }}</a>
      </el-breadcrumb-item>
    </transition-group>
  </el-breadcrumb>
</template>

<script>
export default {
  data() {
    return {}
  },
  computed: {
    levelList() {
      return this.$store.state['common/common'].breadCrumb
    }
  }
};
</script>

<style lang="less" scoped>
.hd-breadcrumb.el-breadcrumb {
  display: inline-block;
  font-size: 14px;
  line-height: 60px;
  margin-left: 8px;

  .no-redirect {
    color: #97a8be;
    cursor: text;
  }
  /* breadcrumb transition */
  .breadcrumb-enter-active,
  .breadcrumb-leave-active {
    transition: all 0.5s;
  }

  .breadcrumb-enter,
  .breadcrumb-leave-active {
    opacity: 0;
    transform: translateX(20px);
  }

  .breadcrumb-move {
    transition: all 0.5s;
  }

  .breadcrumb-leave-active {
    position: absolute;
  }
}
</style>